package com.example.news_reader;

import java.util.ArrayList;

import android.content.Context;

public class NewsList {
	private int cntN;	//뉴스번호
	ArrayList<String> url = null; 
	private Boolean cntC[] = {true,false,false,false,false,false,false,false}; //카테고리번호
	private String[] categoryName = null; //카테고리
	private String key = null;//키워드
	private String[][] news_url = {
			{//한경
				"http://rss.hankooki.com/news/hk_main.xml"		//종합
				,"http://rss.hankooki.com/news/hk_economy.xml"	//경제
				,"http://rss.hankooki.com/news/hk_politics.xml"	//정치
				,"http://rss.hankooki.com/news/hk_society.xml"	//사회
				,"http://rss.hankooki.com/news/hk_world.xml"	//국제
				,"http://rss.hankooki.com/news/hk_entv.xml"		//연예
				,"http://rss.hankooki.com/news/hk_sports.xml"	//스포츠
				,"http://rss.hankooki.com/news/hk_it_tech.xml"	//IT
			},{//중앙
				"http://rss.joinsmsn.com/joins_news_list.xml"		//종합
				,"http://rss.joinsmsn.com/joins_money_list.xml"		//경제
				,"http://rss.joinsmsn.com/joins_politics_list.xml"	//정치
				,"http://rss.joinsmsn.com/joins_life_list.xml"		//사회
				,"http://rss.joinsmsn.com/joins_world_list.xml"		//국제
				,"http://rss.joinsmsn.com/joins_star_list.xml"		//연예
				,"http://rss.joinsmsn.com/joins_sports_list.xml"	//스포츠
				,"http://rss.joinsmsn.com/joins_it_list.xml"		//IT
			},{//조선
				"http://myhome.chosun.com/rss/www_section_rss.xml"		//종합
				,"http://biz.chosun.com/site/data/rss/rss.xml"			//경제
				,"http://www.chosun.com/site/data/rss/politics.xml"		//정치
				,"http://www.chosun.com/site/data/rss/national.xml"		//사회
				,"http://www.chosun.com/site/data/rss/international.xml"//국제
				,"http://www.chosun.com/site/data/rss/ent.xml"			//연예
				,"http://www.chosun.com/site/data/rss/sports.xml"		//스포츠
				,"http://myhome.chosun.com/rss/www_section_rss_16.xml"	//IT
			},{//경향
				"http://www.khan.co.kr/rss/rssdata/total_news.xml"			//종합
				,"http://www.khan.co.kr/rss/rssdata/economy_news.xml"		//경제
				,"http://www.khan.co.kr/rss/rssdata/politic_news.xml"		//정치
				,"http://www.khan.co.kr/rss/rssdata/society_news.xml"		//사회
				,"http://www.khan.co.kr/rss/rssdata/kh_world.xml"			//국제
				,"http://www.khan.co.kr/rss/rssdata/kh_entertainment.xml"	//연예
				,"http://www.khan.co.kr/rss/rssdata/kh_sports.xml"			//스포츠
				,"http://www.khan.co.kr/rss/rssdata/it_news.xml"			//IT
			},{//매일
				"http://file.mk.co.kr/news/rss/rss_40300001.xml"	//종합
				,"http://file.mk.co.kr/news/rss/rss_30100041.xml"	//경제
				,"http://file.mk.co.kr/news/rss/rss_30200030.xml"	//정치
				,"http://file.mk.co.kr/news/rss/rss_50400012.xml"	//사회
				,"http://file.mk.co.kr/news/rss/rss_30300018.xml"	//국제
				,"http://file.mk.co.kr/news/rss/rss_30000023.xml"	//연예
				,"http://file.mk.co.kr/news/rss/rss_50600001.xml"	//스포츠
				,"http://file.mk.co.kr/news/rss/rss_50100032.xml"	//IT
			},{//동아
				"http://rss.donga.com/total.xml"			//종합
				,"http://rss.donga.com/economy.xml"			//경제
				,"http://rss.donga.com/politics.xml"		//정치
				,"http://rss.donga.com/national.xml"		//사회
				,"http://rss.donga.com/international.xml"	//국제
				,"http://rss.donga.com/culture.xml"			//연예
				,"http://rss.donga.com/sports.xml"			//스포츠
				,"http://rss.donga.com/science.xml"			//IT
			},{//한겨레
				"http://www.hani.co.kr/rss/"				//종합
				,"http://www.hani.co.kr/rss/economy/"		//경제
				,"http://www.hani.co.kr/rss/politics/"		//정치
				,"http://www.hani.co.kr/rss/society/"		//사회
				,"http://www.hani.co.kr/rss/international/"	//국제
				,"http://www.hani.co.kr/rss/culture/"		//연예
				,"http://www.hani.co.kr/rss/sports/"		//스포츠
				,"http://www.hani.co.kr/rss/science/"	 	//IT
			}};
	public NewsList(Context con) {
		// TODO Auto-generated constructor stub
		categoryName = con.getResources().getStringArray(R.array.category);
		cntN = 0;
	}
	
	public String getKey() {
		return key;
	}

	public void setKey(String key) {
		this.key = key;
	}

	public int getCntN() {
		return cntN;
	}

	public void setCntN(int cntN) {
		this.cntN = cntN;
	}

	public Boolean getCntC(int num) {
		return cntC[num];
	}
	
	public void setCntC(int num, boolean t) {
		cntC[num] = t;
	}
	
	public void setCntCAll() {
		for(int i=0;i<cntC.length;i++)cntC[i] = false;
	}
	
	public String getCategoryName(int num) {
		return categoryName[num];
	}
	
	public ArrayList<String> getCategoryName() {
		ArrayList<String> name = new ArrayList<String>();
		url = new ArrayList<String>();
		for(int i=0;i<categoryName.length;i++){
			if(cntC[i]){
				name.add(categoryName[i]);
				url.add(news_url[cntN][i]);
			}
		}
		return name;
	}
	
	public String getNews_url(int c_num) {
		return url.get(c_num);
	}
	
	
}
